import http from "@/utils/request";

export const create_conversation = (params: any, callback: any) => {
  return http.request("/v1/conversation/create", "post", params).then((data) => {
    if (data) callback && callback(data);
  });
};

export const create_conversation_message = (params: any, callback: any) => {
  return http.request(`/v1/conversation/message/create?conversation_id=${params.conversation_id}`, "post", params).then((data) => {
    if (data) callback && callback(data);
  });
};

export const get_conversation_message_list = (params: any, callback: any) => {
  return http.request(`/v1/conversation/message/list?conversation_id=${params.conversation_id}`, "post", params).then((data) => {
    if (data) callback && callback(data);
  });
};

export const send_chat = (params: any, callback: any) => {
  return http.request(`/v3/chat?conversation_id=${params.conversation_id}`, "post", params).then((data) => {
    if (data) callback && callback(data);
  });
};

export const retrieve_chat = (params: any, callback: any) => {
  return http.request(`/v3/chat/retrieve`, "get", params).then((data) => {
    if (data) callback && callback(data);
  });
};
